package services;

import domain.entities.Specialty;
import domain.entities.SpecialtyDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: nico
 * Date: 18/09/12
 * Time: 10:42
 * To change this template use File | Settings | File Templates.
 */
@Service
public class SpecialityCRUDService {

    private SpecialtyDAO specialtyDAO;

    public SpecialityCRUDService() {
    }

    @Autowired
    public SpecialityCRUDService(SpecialtyDAO specialtyDAO) {
        this.specialtyDAO = specialtyDAO;
    }

    public Specialty findById(Integer id){
        return specialtyDAO.findById(id);
    }

    public List<Specialty> list(){

        return specialtyDAO.findAll();
    }
}
